<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 200px;
            height: 200px;
            background-color: rgb(175, 144, 43);
        }
        .box2{
            width: 200px;
            height: 200px;
            background-color: rgb(117, 194, 45);
        }
    </style>
</head>
<body>
    <div id="app">
        <button @click="changeState">
            {{isShow?'点击消失':'点击显示'}}
        </button>
        <div class="box" v-if="isShow"></div>
        <div class="box2" v-show="isShow"></div>
    </div>
    <script src="./vue.js"></script>
    <script>
        const vm = new Vue({
            el:"#app",
            data:{
                isShow:true
            },
            methods:{
                changeState(){
                    this.isShow = !this.isShow
                }
            }
        });
        
    </script>
</body>
</html>